package com.neomanager.stats.dao;

import java.util.ArrayList;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class StatsDao extends SqlMapClientDaoSupport
{
	public Logger logger = Logger.getLogger(this.getClass());

	// 총반문자 수 목록
	@SuppressWarnings("unchecked")
	public ArrayList<Map<String, Object>> selectTotalStats(Map<String, Object> param)  throws DataAccessException
	{
		logger.info("총방문자수 목록 DAO");
		ArrayList<Map<String, Object>> rslist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("stats.selectTotalStats", param);
        return rslist;
	}

	// 일별 접속통계/페이지뷰 목록
	@SuppressWarnings("unchecked")
	public ArrayList<Map<String, Object>> selectDayStats(Map<String, Object> param)  throws DataAccessException
	{
		logger.info("일별 접속통계/페이지뷰 DAO");
		ArrayList<Map<String, Object>> rslist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("stats.selectDayStats", param);
        return rslist;
	}

	// 월별 접속통계/페이지뷰 목록
	@SuppressWarnings("unchecked")
	public ArrayList<Map<String, Object>> selectMonthStats(Map<String, Object> param)  throws DataAccessException
	{
		logger.info("월별 접속통계/페이지뷰 DAO");
		ArrayList<Map<String, Object>> rslist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("stats.selectMonthStats", param);
        return rslist;
	}

	// 년도별 접속통계/페이지뷰 목록
	@SuppressWarnings("unchecked")
	public ArrayList<Map<String, Object>> selectYearStats(Map<String, Object> param)  throws DataAccessException
	{
		logger.info("년도별 접속통계/페이지뷰 DAO");
		ArrayList<Map<String, Object>> rslist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("stats.selectYearStats", param);
        return rslist;
	}

	// 게시판별 등록현황 목록
	@SuppressWarnings("unchecked")
	public ArrayList<Map<String, Object>> selectBBSTotalStats(Map<String, Object> param)  throws DataAccessException
	{
		logger.info("게시판별 등록현황 DAO");
		ArrayList<Map<String, Object>> rslist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("stats.selectBBSTotalStats", param);
        return rslist;
	}

}
